<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!-- saved from url=(0027)http://itzoo.info/love.html -->
<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Love</title>
        <meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta content="black" name="apple-mobile-web-app-status-bar-style">
<meta name="format-detection" content="telephone=no">
        <link type="text/css" rel="stylesheet" href="./Love_files/default.css">
        <script type="text/javascript" src="./Love_files/jquery.min.js"></script>
        <script type="text/javascript" src="./Love_files/jscex.min.js"></script>
        <script type="text/javascript" src="./Love_files/jscex-parser.js"></script>
        <script type="text/javascript" src="./Love_files/jscex-jit.js"></script>
        <script type="text/javascript" src="./Love_files/jscex-builderbase.min.js"></script>
        <script type="text/javascript" src="./Love_files/jscex-async.min.js"></script>
        <script type="text/javascript" src="./Love_files/jscex-async-powerpack.min.js"></script>
        <script type="text/javascript" src="./Love_files/functions.js" charset="utf-8"></script>
        <script type="text/javascript" src="./Love_files/love.js" charset="utf-8"></script>
        <script type="text/javascript">
    if(/Android (\d+\.\d+)/.test(navigator.userAgent)){
        var version = parseFloat(RegExp.$1);
        if(version>2.3){
            var phoneScale = parseInt(window.screen.width)/640;
            document.write('<meta name="viewport" content="width=640, minimum-scale = '+ phoneScale +', maximum-scale = '+ phoneScale +', target-densitydpi=device-dpi">');
        }else{
            document.write('<meta name="viewport" content="width=640, target-densitydpi=device-dpi">');
        }
    }else{
        document.write('<meta name="viewport" content="width=640, user-scalable=no, target-densitydpi=device-dpi">');
    }
    //微信去掉下方刷新栏
    if(navigator.userAgent.indexOf('MicroMessenger') >= 0){
        document.addEventListener('WeixinJSBridgeReady', function() {
            //WeixinJSBridge.call('hideToolbar');
        });
    }
    </script>
    </head>
    <body>
        <div id="main">
            <div id="error">亲，您使用的浏览器无法支持即将显示的内容，请换成谷歌(<a href="http://www.google.cn/chrome/intl/zh-CN/landing_chrome.html?hl=zh-CN&brand=CHMI">Chrome</a>)或者火狐(<a href="http://firefox.com.cn/download/">Firefox</a>)浏览器哟~</div>
            <div id="wrap"> 
                <canvas id="canvas" width="480" height="700"></canvas>
            </div>
           
        </div>
    
    <script>
    </script>

    <script>
    $(function(){
        var canvas = $('#canvas');

        if (!canvas[0].getContext) {
            $("#error").show();
            return false;
        }

        var width = canvas.width();
        var height = canvas.height();
        
        canvas.attr("width", width);
        canvas.attr("height", height);

        var w2 = width/2;

        var opts = {
            seed: {
                x: width / 2 - 20,
                color: "rgb(190, 26, 37)",
                scale: 2
            },
            //8个参数，两个 为一点，起 中终，radicu lenthg
              branch: [
                [w2-20, height, w2+40, height/2-100, w2-25, 150, 50, 100, [           //主支干 起点,最下面,往左偏移，往左偏移     30 为粗   100为长
                    [w2, height-300, w2-90,  height-370, w2-180,  height-400, 20, 100, [
                        [w2-90, height-360, w2-110, height-360-30, w2-140, height-370-50, 4, 40]
                    ]],
                    [w2,  height-300-100, 600, 356, 680, 345, 12, 100, [
                        [578, 400, 648, 409, 661, 426, 3, 80]
                    ]],
                    [w2,  150+100, 537, 248, 534, 217, 3, 40],
                    [w2, height/2+20, 413, 247, 328, 244, 9, 80, [
                        [427, 286, 383, 253, 371, 205, 2, 40],
                        [498, 345, 435, 315, 395, 330, 4, 60]
                    ]],
                    [w2, height/2-100-50, 608, 252, 678, 221, 6, 100, [
                        [590, 293, 646, 277, 648, 271, 2, 80]
                    ]]
                ]] 
            ],
            bloom: {
                num: 600,   //花朵的数量
                width: width-40,   //宽
                height:630*(width-40)/480,
            },
            footer: {
                width: width,
                height: 5,
                speed: 10,
            }
        }

        var tree = new Tree(canvas[0], width, height, opts);
        var seed = tree.seed;
        var foot = tree.footer;
        var hold = 1;

       

        var seedAnimate = eval(Jscex.compile("async", function () {
            seed.draw();
            while (hold) {
                $await(Jscex.Async.sleep(10));
            }
            while (seed.canScale()) {
                seed.scale(0.95);
                $await(Jscex.Async.sleep(10));
            }
            while (seed.canMove()) {
                seed.move(0, 2);
                foot.draw();
                $await(Jscex.Async.sleep(10));
            }
        }));

        var growAnimate = eval(Jscex.compile("async", function () {
            do {
                tree.grow();
                $await(Jscex.Async.sleep(10));
            } while (tree.canGrow());
        }));

        var flowAnimate = eval(Jscex.compile("async", function () {
            do {
                tree.flower(2);
                $await(Jscex.Async.sleep(10));
            } while (tree.canFlower());
        }));

      

      

        var runAsync = eval(Jscex.compile("async", function () {


          
            $await(seedAnimate());
           // $await(Jscex.Async.sleep(3000));
           // seed.click();
         

            $await(growAnimate());
            $await(flowAnimate());
          

           
        }));

        runAsync().start();


      

       var clickF = function(e){
            if (e != null) {
                var offset = canvas.offset(), x, y;
                x = e.pageX - offset.left;
                y = e.pageY - offset.top;
                if (seed.hover(x, y)) {
                    hold = 0;
                    canvas.unbind("click");
                    canvas.unbind("mousemove");
                    canvas.removeClass('hand');
                }
            }else{
                hold = 0;
                canvas.unbind("click");
                canvas.unbind("mousemove");
                canvas.removeClass('hand');
            }
        };
       //setTimeout(clickF(),7000);
         //clickF();
        setTimeout( function(e){
            if (e != null) {
                var offset = canvas.offset(), x, y;
                x = e.pageX - offset.left;
                y = e.pageY - offset.top;
                if (seed.hover(x, y)) {
                    hold = 0;
                    canvas.unbind("click");
                    canvas.unbind("mousemove");
                    canvas.removeClass('hand');
                }
            }else{
                hold = 0;
                canvas.unbind("click");
                canvas.unbind("mousemove");
                canvas.removeClass('hand');
            }
        },300);
    });

    </script>
</body></html>